package com.android.fragmentdemo
import android.os.Bundle
import android.util.Log
import androidx.recyclerview.widget.LinearLayoutManager
import com.android.fragmentdemo.adapters.CustomVerticalLayoutManagerAdapter
import com.android.fragmentdemo.databeans.DataFactoryIp
import com.android.fragmentdemo.databinding.ActivityScaleOverloadingBinding
import com.android.fragmentdemo.defineviews.LooperVerticalListDataItemDecoration
import com.hengfoxwolf.commonbase.base.BaseActivity3

class ScaleOverloadingActivity : BaseActivity3<ActivityScaleOverloadingBinding>(ActivityScaleOverloadingBinding::inflate) {

    override fun init(savedInstanceState: Bundle?) {

        val dataSet = DataFactoryIp.createCharStr(15)

        mBinding.rvScaleOverload.apply {
            layoutManager = LinearLayoutManager(this@ScaleOverloadingActivity)

            adapter = CustomVerticalLayoutManagerAdapter().apply {
                updateSpecial(true)
                itemDataSet = dataSet
            }

            setRecyclerListener { holder ->
                //判断item是否回收
                val layoutPosition = holder.layoutPosition
                Log.d(TAG, "layoutPosition:$layoutPosition")
            }

            addItemDecoration(LooperVerticalListDataItemDecoration(context).apply {
                setDrawLastLine(true)
            })
        }
    }

    override fun onStop() {
        super.onStop()

    }

    companion object {
        const val TAG = "ScaleOverloadingActivity"
    }
}